package com.joker.yuwu;

import com.joker.repository.Rootupdatezg;
import net.sf.json.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/rootupdatezg")
//更新展馆订单信息

public class RootUpdateZg extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doGet(req, resp);
        req.setCharacterEncoding("utf-8");
        String zgname=req.getParameter("zgname");
        String zhuangtai=req.getParameter("zhangtai");
        String username=req.getParameter("username");
        Rootupdatezg r1=new Rootupdatezg();
        boolean b1=r1.update(username,zgname);
        JSONObject obj=new JSONObject();
        obj.put("data",b1);
//        resp.getWriter().write(obj.toString());
        resp.sendRedirect("/admin/zgdesign.html");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
